package cn.tedu.zblogs.home.controller;


import cn.tedu.base.response.JsonResult;

import cn.tedu.zblogs.home.pojo.VO.TagVO;
import cn.tedu.zblogs.home.service.HomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "首页标签")
@RestController
@RequestMapping("/home")
// 解决跨域问题  使用网关的时候需要注释掉
//@CrossOrigin
public class TagController {
    @Autowired
    private HomeService homeService;

    @ApiOperation(value = "查询首页标签")
    @GetMapping("tag/select")
    public JsonResult selectHomeTag(){
        log.debug("查询首页标签");
        List<TagVO>list=homeService.selectHomeTag();
        return JsonResult.ok(list);
    }
}
